package cn.service.app_info;

import cn.mapper.app_info.App_infoMapper;
import cn.pojo.App_info;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Transactional(rollbackFor = Throwable.class)
@Service("app_infoService")
public class App_infoServiceImpl implements App_infoService {
    @Resource
    private App_infoMapper app_infoMapper;

    @Override
    public List<App_info> getAppInfoList(String querySoftwareName, Integer queryStatus
            , Integer queryCategoryLevel1, Integer queryCategoryLevel2
            , Integer queryCategoryLevel3, Integer queryFlatformId,
                                         Integer devId, Integer pageIndex, Integer pageSize) {
        return app_infoMapper.getAppInfoList(querySoftwareName,queryStatus,queryCategoryLevel1
                                            ,queryCategoryLevel2,queryCategoryLevel3,queryFlatformId
                                            ,devId,(pageIndex-1)*pageSize,pageSize);
    }

    @Override
    public int getAppInfoCount(String querySoftwareName, Integer queryStatus,
                               Integer queryCategoryLevel1, Integer queryCategoryLevel2
            , Integer queryCategoryLevel3, Integer queryFlatformId, Integer devId) {

        return app_infoMapper.getAppInfoCount(querySoftwareName,queryStatus,queryCategoryLevel1
                                ,queryCategoryLevel2,queryCategoryLevel3,queryFlatformId
                                ,devId);
    }

    @Override
    public List<App_info> list() {
        return app_infoMapper.list();
    }

    @Override
    public int apkName(String APKName) {
        return app_infoMapper.apkName(APKName);
    }

    @Override
    public int addApp_info(App_info app_info) {
        return app_infoMapper.addApp_info(app_info);
    }

    @Override
    public App_info getAPP_infoById(Integer id) {
        return app_infoMapper.getAPP_infoById(id);
    }

    @Override
    public int change(App_info app_info) {
        return app_infoMapper.change(app_info);
    }

    @Override
    public int del(Integer id) {
        return app_infoMapper.del(id);
    }
}
